/**********************************************************************************************/
// dgt_Log.h
//
// Log mechanism for DStudio
// Copyright Diamant Group 2008
/**********************************************************************************************/
#ifndef _DGT_LOG_H_
#define _DGT_LOG_H_

#include <iostream>
#include <fstream>
#include <map>
#include "dgtKernel.h"
#include "dgt_BoolFunction.h"
#include "dgt_BoolElement.h"
#include "dgt_AlgAction.h"
#include "dgt_AlgConditions.h"
#include "dgt_AlgLogic.h"
#include "dgt_AlgVar.h"

using namespace std;

/************************************************************************************************/
		void				InitLog( void );

/************************************************************************************************/
		void				log_start(	const char* inModuleName,
										const char* inFuncName );

		void				log_param(	const char* inPrefix, 
										const char* inParamName, 
										int inValue );
		void				log_param(	const char* inPrefix, 
										const char* inParamName, 
										long inValue );
		void				log_param(	const char* inPrefix, 
										const char* inParamName, 
										unsigned inValue );
		void				log_param(	const char* inPrefix, 
										const char* inParamName, 
										unsigned long inValue );
		void				log_param(	const char* inPrefix, 
										const char* inParamName, 
										double inValue );
		
		void				log_param(	const char* inPrefix, 
										const char* inParamName, 
										wxString inValue );
		void				log_param(	const char* inPrefix, 
										const char* inParamName, 
										wxArrayString inValue );
		void				log_param(	const char* inPrefix, 
										const char* inParamName, 
										wxArrayInt inValue );
		void				log_param(	const char* inPrefix, 
										const char* inParamName, 
										map<int, bool> inValue );

		void				log_param(	const char* inPrefix, 
										const char* inParamName, 
										BoolElementArray inValue );
		void				log_param(	const char* inPrefix, 
										const char* inParamName, 
										dgt_BoolFunction_Ptr inValue );
		void				log_param(	const char* inPrefix, 
										const char* inParamName, 
										dgt_LogicTable_Ptr inValue );
		void				log_param(	const char* inPrefix, 
										const char* inParamName, 
										dgt_AlgActArray inValue );
		void				log_param(	const char* inPrefix, 
										const char* inParamName, 
										dgt_AlgCondArray inValue );
		void				log_param(	const char* inPrefix, 
										const char* inParamName, 
										dgt_AlgLogArray inValue );
		void				log_param(	const char* inPrefix, 
										const char* inParamName, 
										dgt_AlgVarArray inValue );


/************************************************************************************************/
		void				log_return( const char* inFuncName );
		void				log_return( const char* inFuncName, const char* inName, int inValue );
		void				log_return( const char* inFuncName, const char* inName, unsigned inValue );
		void				log_return( const char* inFuncName, const char* inName, long inValue );
		void				log_return( const char* inFuncName, const char* inName, unsigned long inValue );
		void				log_return( const char* inFuncName, const char* inName, double inValue );

		void				log_return( const char* inFuncName, const char* inName, BoolElementArray inValue );
		void				log_return( const char* inFuncName, const char* inName, wxArrayString inValue );
		void				log_return( const char* inFuncName, const char* inName, wxArrayInt inValue );
		void				log_return( const char* inFuncName, const char* inName, wxBoolArray inValue );
		void				log_return( const char* inFuncName, const char* inName, wxString inValue );
		void				log_return( const char* inFuncName, const char* inName, map<int, bool> inValue );
		void				log_return( const char* inFuncName, const char* inName, dgt_BoolFunction_Ptr inValue );
		void				log_return( const char* inFuncName, const char* inName, dgt_BoolElement_Ptr inValue );
		void				log_return( const char* inFuncName, const char* inName, dgt_AlgActArray inValue );	// TODO 
		void				log_return( const char* inFuncName, const char* inName, dgt_AlgCondArray inValue );	// TODO 
		void				log_return( const char* inFuncName, const char* inName, dgt_AlgLogArray inValue );	// TODO 
		void				log_return( const char* inFuncName, const char* inName, dgt_AlgVarArray inValue );	// TODO 

/**********************************************************************************************/
#define START( mName, Name )		log_start( mName, Name );
#define LOG_PARAM( x )				log_param( "PARAM: ", #x, x );
#define RETURN_VOID( Name )			log_return( Name );	
#define RETURN( Name, x )			log_return(	Name, #x, x );

#endif	// _DGT_LOG_H_